import os
import json
cookie_str=("_gcl_au=1.1.202873475.1705653622; __ssid=a2228e08fa19ae7261f5774817bdfdb; __stripe_mid=76ca687a-3547-4b71-a31f-ab101c4936aee5b611; __stripe_sid=aa8aefc5-d336-4671-b5d1-449ff99e408fd08968; intercom-device-id-lupk8zyo=da883a20-0d73-47d0-85f7-1e1ae12bdc98; intercom-session-lupk8zyo=L24xTE9PZzR0YkJ0bzFGRnVuUUhJemU1aWpKRXp3aHlXdjAyL2UydThYeFptemtNclJxcEdjNVVNZ1JEQStHMC0tNlhjNmI5RzNuOWV3OFRwY080RjZLZz09--747bdd5afbe88c745ddf05711c1cefb73acc82b5; sessionKey=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"
            "; __cf_bm=RCV4OhF5oVws_V3Wyt0tHytxgm07B.tYJ2R4ETCxCyE-1705663138-1-AWWRBjpgDB7VQtmnezSoEJ1VZs6aIZEaeI+60qmSdx6T2KAx7SV0kJh1jHwd2v1aGfOmRA0omUIYuMyNk7GKTd0="
            "")
coos={}
cookies=cookie_str.split('; ')
for i in cookies:
    coos[i.split('=')[0]]=i.split('=')[1]


with open('./claudecookies.txt', 'r', encoding='utf8') as f:
    listCookies = json.loads(f.read())
new_list=[]
for cookie in listCookies:
    cookie["name"]=coos[cookie["name"]]
    new_list.append(cookie)

print(new_list)

jsonCookies = json.dumps(new_list)

with open("claudecookies_test.txt", 'w') as f:
    f.write(jsonCookies)






